package com.amos.muexamclient.framework.service;

import java.util.concurrent.TimeUnit;

/**
 * Copyright © 2018 嘉源锐信. All rights reserved.
 *
 * @Project: mu-exam
 * @ClassName: RedisService
 * @Package: com.amos.muexamclient.framework.service
 * @author: zhuqb
 * @Description: Redis操作接口
 * @date: 2020/3/24 0024 下午 15:01
 * @Version: V1.0
 */
public interface RedisService {
    /**
     * 保存键值对
     *
     * @param key
     * @param value
     * @param expireTime
     * @param timeUnit
     * @return
     */
    boolean save(String key, Object value, Integer expireTime, TimeUnit timeUnit);

    /**
     * 保存键值对
     *
     * @param key
     * @param value
     * @param expireTime
     * @return
     */
    boolean save(String key, Object value, Integer expireTime);

    /**
     * 获取键值
     *
     * @param key
     * @return
     */
    <T> T getKey(String key);

    /**
     * 删除
     *
     * @param userKey
     */
    void delete(String userKey);
}
